package com.siashan.toolkit.api.security.interceptor;

import com.siashan.toolkit.api.security.anno.EncryptValidated;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;


/**
 * 分布式锁aop处理器
 *
 * @author siashan
 * @since v1.0.1
 */
@Slf4j
@RequiredArgsConstructor
public class RestCreptInterceptor implements MethodInterceptor {

    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {

        try {
            EncryptValidated encryptValidated = invocation.getMethod().getAnnotation(EncryptValidated.class);
            if (null != encryptValidated){
                Object[] arguments = invocation.getArguments();
                if (arguments.length > 0){
                    Object argument = arguments[0];

                }

            }


            return null;
        } finally {

        }
    }

}
